import BaseEnumFactory from "/@/constant/BaseEnumFactory";

/** 账户关联的用户信息 */
export default class UserResponse  { 
  userId!:string;
  userNo!:string;
  userName!:string;
  userTitle!:string;
  userSex!:EnumStruct<UserEnum_UserSex>;
  birthday!:string;
  identityCard!:string;
  telNo!:string;
  email!:string;
  wechat!:string;
  tencent!:string;
  userPortrait!:string;
  address!:string;
  userType!:EnumStruct<UserEnum_UserType>;
  status!:EnumStruct<UserEnum_Status>;
  addUser!:string;
  addTime!:string;
  updUser!:string;
  updTime!:string;

  constructor(){
    this.userSex=BaseEnumFactory.UserEnum_UserSex.UNKNOWN_TYPE;
    this.userType=BaseEnumFactory.UserEnum_UserType.ORDINARY_USER;
    this.status=BaseEnumFactory.UserEnum_Status.ENABLE;

  }


  /**通过JSONObject创建实例对象 */
  public static getInstanceByJSONObj(jsonObj:any):UserResponse{  
    let instance=new UserResponse()  
    let rs= Object.assign(instance, jsonObj) 
    return rs
  }


  /** 通过属性参数创建实例对象 */
  public static getInstanceByParam(userId:string,userNo:string
                                   ,userName:string,userTitle:string
                                   ,userSex:EnumStruct<UserEnum_UserSex>,birthday:string
                                   ,identityCard:string,telNo:string
                                   ,email:string,wechat:string
                                   ,tencent:string,userPortrait:string
                                   ,address:string,userType:EnumStruct<UserEnum_UserType>
                                   ,status:EnumStruct<UserEnum_Status>,addUser:string
                                   ,addTime:string,updUser:string
                                   ,updTime:string){ 
    let instance=new UserResponse()  
    instance.userId=userId;
    instance.userNo=userNo;
    instance.userName=userName;
    instance.userTitle=userTitle;
    instance.userSex=userSex;
    instance.birthday=birthday;
    instance.identityCard=identityCard;
    instance.telNo=telNo;
    instance.email=email;
    instance.wechat=wechat;
    instance.tencent=tencent;
    instance.userPortrait=userPortrait;
    instance.address=address;
    instance.userType=userType;
    instance.status=status;
    instance.addUser=addUser;
    instance.addTime=addTime;
    instance.updUser=updUser;
    instance.updTime=updTime;
    return instance 
  }


  /** 类属性的申明静态变量(适用于直接用到Class.fieldName的场景) */
   static fieldNames={ userId:"userId",userNo:"userNo",userName:"userName",userTitle:"userTitle",userSex:{code:"userSex.code",value:"userSex.value",this:"userSex"},birthday:"birthday",identityCard:"identityCard",telNo:"telNo",email:"email",wechat:"wechat",tencent:"tencent",userPortrait:"userPortrait",address:"address",userType:{code:"userType.code",value:"userType.value",this:"userType"},status:{code:"status.code",value:"status.value",this:"status"},addUser:"addUser",addTime:"addTime",updUser:"updUser",updTime:"updTime" } 
}

